////
////  ListAdjacence.cpp
////  Taquin
////
////  Created by Benjamin Bouachour on 12/08/11.
////  Copyright 2011 Epitech. All rights reserved.
////

#include "ListAdjacence.h"

ListAdjacence::ListAdjacence()
{
    _graphe =  l_adjacence();
}

ListAdjacence::ListAdjacence(const ListAdjacence &copie) : _graphe(copie._graphe)
{

}

ListAdjacence::~ListAdjacence()
{}

ListAdjacence & ListAdjacence::operator=(const ListAdjacence& o)
{
        _graphe = o._graphe;
//    map<Noeud *, vector<Noeud*> >::const_iterator it;
//    for(it = o._graphe.begin(); it != o._graphe.end(); ++it)
//        _graphe[it->first] = it->second;
        return *this;
}

const vector<Noeud *> &ListAdjacence::getVoisins(Noeud *node) 
{
    
    return _graphe[node];
}

const void ListAdjacence::setVoisins( Noeud *key,  vector<Noeud*> &value)
{
    _graphe[key] = value;
    cout << "une liste de voisin à été ajouté au noeud : " << key->getName() << endl; 
}

const void ListAdjacence::addNoeud( Noeud *noeud,  vector<Noeud *> &value)
{
    _graphe.insert(pair<Noeud *, vector<Noeud *> >(noeud, value));
    cout << "Un noeud à été inséré!" << endl;
}

